/*
 * FileName: StaffDailyService.java
 *
 */
package com.mrc.ak.daily.service;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mrc.ak.daily.dao.DailyTypeDefDao;
import com.mrc.ak.daily.model.DailyTypeDef;
import com.mrc.core.base.Constant;
import com.mrc.core.model.SysUser;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author Mrc
 * @version 4.1

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2016-12-22 上午10:17:42          Mrc        4.1         To create
 * </p>
 *
 * @since 
 * @see     
 */
@Service
@Transactional
public class DailyTypeDefService {
    @Autowired
    private DailyTypeDefDao dailyTypeDefDao;

    /**
     * 保存
     * @param user
     * @param columnKey
     * @param columnValue
     */
    public void save(SysUser user, List<String> columnKey, List<String> columnValue) {
        DailyTypeDef dailyTypeDef = new DailyTypeDef();
        dailyTypeDef.setColumnKey(columnKey);
        dailyTypeDef.setColumnValue(columnValue);
        dailyTypeDef.setCreateCode(user.getMobile());
        dailyTypeDef.setCreateDate(new Date());
        dailyTypeDef.setStatus(Constant.STATUS_NORMAL);
        dailyTypeDefDao.save(dailyTypeDef);
    }

    /**
     * 根据状态查询 
     * @param status
     * @return
     */
    public List<DailyTypeDef> queryList(Integer status) {
        return dailyTypeDefDao.queryList(status);
    }

}
